package com.frank.libandroid.util;

import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

public class BindingAdapter {
    @androidx.databinding.BindingAdapter("isHorizontal")
    public static void isHorizontal(RecyclerView recyclerView, boolean b) {
        RecyclerView.LayoutManager layoutManager = recyclerView.getLayoutManager();
        if (layoutManager instanceof LinearLayoutManager) {
            ((LinearLayoutManager) layoutManager).setOrientation(RecyclerView.HORIZONTAL);
        }
    }
}
